]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-tool: Compile GSettings schemas after install
authorAndy Holmes <andrew.g.r.holmes@gmail.com>
Sun, 12 Feb 2023 22:15:00 +0000 (14:15 -0800)
committerMarge Bot <marge-bot@gnome.org>
Mon, 13 Feb 2023 00:01:08 +0000 (00:01 +0000)
Extensions may soon stop shipping compiled GSchemas, so ensure the
schemas are compiled after install, as with GNOME Shell.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2638>

subprojects/extensions-tool/src/command-install.c

index 2eefabafa3fbbe1926cea8f6f8cfbad9c8c2a537..11fb4b6b723f4abd76e9f70e473f45834b794db5 100644 (file)
@@ -95,6 +95,7 @@ install_extension (const char *bundle,
   g_autoptr (GFile) src = NULL;
   g_autoptr (GFile) dst = NULL;
   g_autoptr (GFile) dstdir = NULL;
+  g_autoptr (GFile) schemadir = NULL;
   g_autoptr (GError) error = NULL;
   g_autofree char *cwd = NULL;
   const char *uuid;
@@ -148,6 +149,22 @@ install_extension (const char *bundle,
   if (!g_file_move (tmpdir, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, &error))
     goto err;
 
+  schemadir = g_file_get_child (dst, "schemas");
+
+  if (g_file_query_exists (schemadir, NULL))
+    {
+      g_autoptr (GSubprocess) proc = NULL;
+      g_autofree char *schemapath = NULL;
+
+      schemapath = g_file_get_path (schemadir);
+      proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDERR_SILENCE, &error,
+                               "glib-compile-schemas", "--strict", schemapath,
+                               NULL);
+
+      if (!g_subprocess_wait_check (proc, NULL, &error))
+        goto err;
+    }
+
   return 0;
 
 err: